<div class="container" ng-controller="indiesViewHome">

    <div class="row col-md-12 panel panel-default">
        <div class="panel-heading">Indices View</div>
        <div class="panel-body">
            <div class="row">
                    <div class="col-md-3">
                            Indices: <br><span class="badge">{{info.indexSize| currency:"":0}}</span>
                    </div>

                    <div class="col-md-3">
                            Documents: <br><span class="badge">{{info.doc | currency:"":0}}</span>
                    </div>

                    <div class="col-md-3">
                            Disk Usage: <br><span class="badge">{{info.store}}</span>
                    </div>

                    <div class="col-md-3">
                            Shards: <br><span class="badge">{{info.shards| currency:"":0}}</span>
                    </div>
            </div>
        </div>

        <div class="col-md-12">
                <div class="col-md-4">
                    <input type="text" class="form-control" ng-model="indexName" ng-disabled="edit" placeholder="Index Name"> &nbsp;&nbsp;
                </div>
                
                <div class="col-md-4">
                  <input type="text" ng-blur="changePattern()" class="form-control" ng-model="pattern" ng-disabled="edit"  placeholder="pattern"> &nbsp;&nbsp;
                </div>

                <div class="col-md-1">
                    <input type="checkbox" ng-model="merge" ng-checked="true">merge
                </div>
        </div>
           
            <table class="table table-bordered table-hover table-condensed">
                <thead>
                    <tr>
                        <td>#</td>
                        <td ng-click="predicate = 'indexName'">index name
                            <i ng-click="order('indexName')" ng-show="predicate === 'indexName'" ng-class="reverse?'fa fa-sort-down':'fa fa-sort-up';"></i>
                        </td>
                        <td ng-click="predicate = 'totalSize'">total size
                            <i ng-click="order('totalSize')" ng-show="predicate === 'totalSize'" ng-class="reverse?'fa fa-sort-down':'fa fa-sort-up';"></i>
                        </td>
                        <td ng-click="predicate = 'totalDocs'">total docs
                            <i ng-click="order('totalDocs')" ng-show="predicate === 'totalDocs'" ng-class="reverse?'fa fa-sort-down':'fa fa-sort-up';"></i>
                        </td>
                        <td ng-click="predicate = 'primariesSize'">primaries size
                            <i ng-click="order('primariesSize')" ng-show="predicate === 'primariesSize'" ng-class="reverse?'fa fa-sort-down':'fa fa-sort-up';"></i>
                        </td>
                        <td ng-click="predicate = 'primariesDocs'">primaries docs
                            <i ng-click="order('primariesDocs')" ng-show="predicate === 'primariesDocs'" ng-class="reverse?'fa fa-sort-down':'fa fa-sort-up';"></i>
                        </td>

                        <td ng-click="predicate = 'totalSearch'">search count
                            <i ng-click="order('totalSearch')" ng-show="predicate === 'totalSearch'" ng-class="reverse?'fa fa-sort-down':'fa fa-sort-up';"></i>
                        </td>

                        <td ng-click="predicate = 'totalQuery'">query count
                            <i ng-click="order('totalQuery')" ng-show="predicate === 'totalQuery'" ng-class="reverse?'fa fa-sort-down':'fa fa-sort-up';"></i>
                        </td>

                        <td ng-click="predicate = 'totalGet'">get count
                            <i ng-click="order('totalGet')" ng-show="predicate === 'totalGet'" ng-class="reverse?'fa fa-sort-down':'fa fa-sort-up';"></i>
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="(key, index) in indices | orderBy:predicate:reverse">
                        <td>{{ key }}</td>
                        <td>{{ index.indexName }}</td>
                        <td> {{ index.totalSizeHuman}}</td>
                        <td>{{ index.totalDocs | currency:"":0}}</td>
                        <td> {{ index.primariesSizeHuman}}</td>
                        <td> {{ index.primariesDocs| currency:"":0}}</td>

                        <td> {{ index.totalSearch| currency:"":0}}</td>
                        <td> {{ index.totalQuery| currency:"":0}}</td>
                        <td> {{ index.totalGet| currency:"":0}}</td>
                    </tr>
                </tbody>
            </table>
    </div>
</div>